'''
纯暴力就能过
https://www.nowcoder.com/practice/bf877f837467488692be703735db84e6
'''
import sys
sys.setrecursionlimit(10 ** 9)

n, bag_weight = map(int, input().split())
weights = list(map(int, input().split()))
weights.sort()

def f(weights, rest):
    if rest < 0: return 0
    if rest == 0: return 1
    # 剪枝
    if sum(weights) <= rest:
        return 2 ** len(weights)
    return f(weights[:-1], rest) + f(weights[:-1], rest - weights[-1])
print(f(weights, bag_weight))

